<?php
include("timer.php");
include("../db_connection.php");
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>sample page</title>
<link rel="stylesheet" href="style.css" type="text/css" media="screen">
</head>

<body onLoad="TimeCountDown()">
<div id="wrapper">
	<div id="header">
		<div id="logo"></div>
		<div id="menu">
        <?php
			include("menu.php");
		?>
        <!--
			<a href="">首頁</a> | <a href="">成績</a> | <a href="">註冊班級</a> | <a href="">帳號</a> | <a href="">線上聽力</a> | <a href="">聯絡我們</a> | <a href="">版本說明</a>
            !-->
		</div>
	</div>
	<div class="clearer"></div>
	<div class="edge-top"></div>

	<div id="main">

		<div id="title">Keyword練習<font size=4><br>標出各段的keyword</font></div>
<hr/><br><br>

<!-- 內文開始 !-->
<form>
<?php
	$aid = 1;
	$sql = "SELECT * FROM paragraph WHERE aid ='".$aid."' ORDER BY paragraph, seq";
	$result = mysql_query($sql, $link);
	if($result)
	{
		$num = mysql_num_rows($result);
		$paragraph = 1;
		for($i=0;$i<$num;$i++)
		{
			$data = mysql_fetch_row($result);
			if($data[3]!=$paragraph)
			{
				
				echo "<br>";
				echo "&nbsp;&nbsp;&nbsp;&nbsp;Keyword:<input id='keyword".$paragraph."' type='text'>\n";
				echo "<br><br>";
				$paragraph = $data[3];
			}
			echo $data[4]."<span id = 'para".$i."' ondblclick='split_paragraph(".$i.")'></span>\n";
			echo "<input id='ifsplit".$i."' type='hidden' value='0'> \n";
			
		}
		echo "<br>";
		echo "&nbsp;&nbsp;&nbsp;&nbsp;Keyword:<input id='keyword".$paragraph."' type='text'>\n";
		echo "<br><br>";
	}
?>

	<table width="100%">
	<tr><td align='right'><input  id='KWsubmit' type='submit' value='next''></td></tr>
	</table>


</form>
<!-- 內文結束 !-->

	</div>
    <div class="edge-bottom"></div>
    <div id="footer"><?php  include("footer.php"); ?></div>
</div>

<div id="txt">18:27</div>
<!--
<div id="association">&nbsp;association</div>
<div id="voc_cart">&nbsp;vocabulary cart</div> 
!-->
</body>
</html>